package com.chuangsi.common.enums;

import cn.hutool.core.util.StrUtil;

public enum FirstCarEnum {

    yes(0, "是"),
    no(1, "否"),
    ;



    private Integer type;

    private String typeName;

    FirstCarEnum(Integer type, String typeName) {
        this.type = type;
        this.typeName = typeName;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public static String getName(Object type) {
        if(type == null|| StrUtil.isBlank(type.toString())){
            return "";
        }
        Integer myType = Integer.parseInt(type.toString());
        for (FirstCarEnum dualControlEnum : values()) {
            if(dualControlEnum.getType().equals(myType)) return dualControlEnum.getTypeName();
        }
        return "";
    }
}
